<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'index.jsp' starting page</title>
		<style type="text/css" title="currentStyle">
@import "/FileBackup/css/demo_page.css";

@import "/FileBackup/css/demo_table.css";
</style>
		<script type="text/javascript" src="/FileBackup/js/jquery.js">
</script>
		<script type="text/javascript"
			src="/FileBackup/js/jquery.dataTables.js">
</script>
		<script type="text/javascript">
$(document).ready(function() {
	var aSelected = [];
	var datatables = null;
	var datatables = $('#example').dataTable( {
		 'bPaginate': true,    
                      "bProcessing": true,  
                    'bLengthChange': true,   
                    'sPaginationType': 'full_numbers',
		"sAjaxSource" : 'initialFileTableAction.action',
		"oLanguage" : {
			"sProcessing" : "正在加载数据...",
			'sSearch' : '数据筛选:',
			"sLengthMenu" : "每页显示 _MENU_ 项记录",
			"sZeroRecords" : "没有符合项件的数据...",
			"sInfo" : "当前数据为从第 _START_ 到第 _END_ 项数据；总共有 _TOTAL_ 项记录",
			"sInfoEmpty" : "显示 0 至 0 共 0 项",
			"sInfoFiltered" : "(_MAX_)"
		},

		"aoColumns" : [

		{
			"mDataProp" : "name"
		}, {
			"mDataProp" : "kind"
		},{
			"mDataProp" : "id", "bSearchable": false, "bVisible": false
		} ,{
			"mDataProp" : "upperId", "bSearchable": false, "bVisible": false
		}  ],
		"fnRowCallback" : function(nRow, aData, iDisplayIndex) {
		
			if (jQuery.inArray(aData.id, aSelected) != -1) {
				$(nRow).addClass('row_selected');
			}
		}
	});
	$('#example tbody tr').live('click', function () {
	var aData=datatables.fnGetData(this);
	if(aData.kind=="folder"){
	
	var url='getSubFileAction.action?upperId='+aData.id;;
    		var params={};
    		jQuery.post(url,params,callbackFun,'json');}
    	
	} );
	function callbackFun(data){
			datatables.fnClearTable();
    		datatables.fnAddData(eval(data))
    	}
});

</script>
	</head>

	<body id="dt_example">
		<div id="container">

			<h1>
				<a href="/FileBackup/pages/share.jsp" id="link">Share List</a>
			</h1>
			<div id="dynamic">
				<table cellpadding="0" cellspacing="0" border="0" class="display"
					id="example">
					<thead>
						<tr>
							<th width="60%">
								name
							</th>
							<th width="40%">
								kind
							</th>
							<th>
								
							</th>
							<th>
								
							</th>
						</tr>
					</thead>
					<tbody>

					</tbody>
					<tfoot>
						<tr>
							<th>
								name
							</th>
							<th>
								kind
							</th>
						</tr>
					</tfoot>
				</table>
			</div>
			<div class="spacer"></div>
		</div>






	</body>
</html>
